package com.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 添加静态资源的访问路径
        registry.addResourceHandler("/static/**")
                .addResourceLocations("classpath:/static/");

        // 如果你有其他静态资源目录，也可以继续添加
        // registry.addResourceHandler("/images/**")
        //         .addResourceLocations("file:/path/to/your/images/");
    }
}